<template>
	<view class="people-content">
		<uni-nav-bar fixed class="unibarS">
			<block slot="left">
				<text>我的</text>
			</block>
			<block slot="right">
				<uni-icons @click="goSet()" type="gear" size="26"></uni-icons>
			</block>
		</uni-nav-bar>
		<view class="text-area">
			<view>
				<view class="name">{{ user.data.userName }}</view>
				<view class="job">{{ user.postGroup }}</view>
				<view class="phone">{{ user.data.phonenumber }}</view>
			</view>
			<u-avatar :src="user.data.avatar" shape="square"></u-avatar>
		</view>
	</view>
</template>
<script>
export default {
	data() {
		return {
			src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
			user: {
				data: {}
			}
		}
	},
	onShow() {
		this.getData()
	},
	methods: {
		getData() {
			this.$http.get('/system/user/profile', {}).then(res => {
				if (res.code == 200) {
					this.user = res
				} 
			})
		},
		goSet() {
			uni.navigateTo({
				url: '/pages/people/set'
			})
		}
	}
}
</script>

<style lang="scss" scoped>
	.unibarS {
		/deep/.uni-navbar__header {
			padding: 0 32rpx;
		}
		/deep/.uni-navbar__content {
			background-color: white !important;
			border-bottom: none !important;
			box-shadow: 0px 0px 4px  rgba(136, 136, 136, 0.12);
		}
		/deep/.uni-navbar__header-btns-left {
			font-size: 36rpx;
		}
	}
	.people-content {
		height: calc(100vh - 50px - var(--status-bar-height));
		background: rgba(247, 248, 250, 1);
		padding: 0 32rpx;
		.text-area {
			margin-top: 32rpx;
			padding: 48rpx 44rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-radius: 24px;
			background: rgba(255, 255, 255, 1);
			.name {
				font-size: 36rpx;
				font-weight: 500;
				color: rgba(12, 16, 25, 1);
				margin-bottom: 16rpx;
			}
			.job {
				font-size: 28rpx;
				font-weight: 500;
				color: rgba(103, 117, 133, 1);
			}
			.phone {
				font-size: 28rpx;
				font-weight: 500;
				color: rgba(12, 16, 25, 1);
			}
		}
	}

</style>
